import { LINK_TYPE } from '@/enum/carousel';
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
import { BaseEntity } from './base.entity';

@Entity('carousel')
export class Carousel extends BaseEntity {
  @PrimaryGeneratedColumn({
    type: 'int',
    name: 'id',
    comment: '主键,自增',
  })
  id: number;

  @Column({
    type: 'int',
    name: 'link_type',
    comment: '点击轮播图跳转类型',
  })
  linkType: LINK_TYPE;

  @Column({
    type: 'text',
    name: 'link',
    comment: '点击轮播图跳转链接',
  })
  link: string;

  @Column({
    type: 'text',
    name: 'path',
    comment: '轮播图图片地址',
  })
  path: string;

  @Column({
    type: 'int',
    name: 'level',
    comment: '轮播图排序序号',
  })
  level: number;
}
